package buttons;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import controller.TurtleController;

public class ZoomButton
{
    JButton myButton;
    TextInput myText;
    TurtleController myController;
    double myZoomFactor;

    public ZoomButton(String name, TurtleController controller,
            double zoomFactor)
    {
        myButton = new JButton(name);
        myController = controller;
        myZoomFactor = zoomFactor;

        myButton.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent e)
            {
                myController.zoomCamera(myZoomFactor);
            }
        });
    }

    public JButton getInstance()
    {
        return myButton;
    }
}
